// pages/index/index.js
// 引入封装好的promis
import {
  request
} from '../../request/index';
import regeneratorRuntime from '../../lib/runtime/runtime.js';
Page({
  data: {
    swiperList: [],
    navList: [],
    floorList: []
  },
  //  页面加载的时候执行
  onLoad() {
    this.getSwiperList();
    this.getNavList();
    this.getFloorList();
    console.log(request)
  },
  async getSwiperList() {
    const result = await request({
      url: "/home/swiperdata"
    });
    this.setData({
      swiperList: result,
    });
  },
  async getNavList() {
    const result = await request({
      url: '/home/catitems'
    });
    this.setData({
      navList: result,
    });
  },
  async getFloorList() {
    const result = await request({
      url: '/home/floordata'
    });
    this.setData({
      floorList: result,
    });
  }
})